-
Notifications
You must be signed in to change notification settings - Fork 47
Make index swaps tests more permissive #645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughTest updated in spec/meilisearch/client/indexes_spec.rb: assertion changed from strict array equality to inclusion-based checks for swap entries, allowing order-insensitive matching and extra entries while verifying presence of two specific swap index pairs. Changes
Sequence Diagram(s)Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #645 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 806 806
=========================================
Hits 806 806 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
spec/meilisearch/client/indexes_spec.rb (2)
271-274
: Make the pair-level check order-agnostic as wellAs written, the inner arrays for 'indexes' must match in the exact order (['indexA', 'indexB'] vs ['indexB', 'indexA']). If the API returns pairs in a different order, this will still fail. Use match_array to allow either order within each pair.
Suggested change:
- expect(task['details']['swaps']).to include( - include('indexes' => ['indexA', 'indexB']), - include('indexes' => ['indexC', 'indexD']) - ) + expect(task['details']['swaps']).to include( + include('indexes' => match_array(%w[indexA indexB])), + include('indexes' => match_array(%w[indexC indexD])) + )
271-274
: Optional: pre-assert the shape for clearer failuresAdding a couple of light-weight assertions improves failure messages when the API payload changes.
- expect(task['details']['swaps']).to include( + expect(task['details']).to include('swaps') + expect(task['details']['swaps']).to be_an(Array) + expect(task['details']['swaps']).to include( include('indexes' => ['indexA', 'indexB']), include('indexes' => ['indexC', 'indexD']) )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
spec/meilisearch/client/indexes_spec.rb
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
spec/meilisearch/client/indexes_spec.rb (2)
lib/meilisearch/client.rb (1)
task
(424-426)lib/meilisearch/task.rb (1)
task
(19-21)
🔇 Additional comments (1)
spec/meilisearch/client/indexes_spec.rb (1)
271-274
: Good call making the swaps assertion permissive to reduce test brittlenessSwitching to inclusion-based checks makes the test resilient to ordering and any extra swap entries returned by the API. This should help stabilize the suite across Meilisearch versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors merge
Build succeeded:
|
Fix Meilisearch 1.18 tests run
Summary by CodeRabbit